//===============================================================================
// Microsoft patterns & practices
// Smart Client Software Factory 2010
//===============================================================================
// Copyright (c) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================
using System;

namespace Microsoft.Practices.SmartClient.DisconnectedAgent
{
	/// <summary>
	/// An object representing a request.
	/// </summary>
	public class Request
	{
		private OfflineBehavior behavior;
		private object[] callParameters;
		private string methodName;
		private string endpoint;
		private Type onlineProxyType;
		private Guid requestId;

		/// <summary>
		/// Default constructor.
		/// It sets a new RequestId, an empty Behavior and an empty CallParameters object array.
		/// </summary>
		public Request()
		{
			requestId = Guid.NewGuid();
			behavior = new OfflineBehavior();
			callParameters = new object[0];
		}

		/// <summary>
		/// Offline behavior for the current request.
		/// It contains several options.
		/// </summary>
		public OfflineBehavior Behavior
		{
			get { return behavior; }
			set { behavior = value; }
		}

		/// <summary>
		/// Object array with the parameters to be used dispatching the request.
		/// </summary>
		public object[] CallParameters
		{
			get { return callParameters; }
			set { callParameters = value; }
		}

		/// <summary>
		/// Logical endpoint name for the request.
		/// </summary>
		public string Endpoint
		{
			get { return endpoint; }
			set { endpoint = value; }
		}

		/// <summary>
		/// Global unique identifier for the request.
		/// </summary>
		public Guid RequestId
		{
			get { return requestId; }
			set { requestId = value; }
		}

		/// <summary>
		/// Method to be invoked in the dispatching process.
		/// </summary>
		public string MethodName
		{
			get { return methodName; }
			set { methodName = value; }
		}

		/// <summary>
		/// Type of the proxy object for dispatching.
		/// It use to be the proxy class generated by Visual Studio.
		/// </summary>
		public Type OnlineProxyType
		{
			get { return onlineProxyType; }
			set { onlineProxyType = value; }
		}
	}
}